@using OurWedding1
@{
    ViewBag.Title = Resources.Guests_List;   
}

@Html.Partial("_GuestsHeading")
<h2>@ViewBag.Title</h2>

<div id="toolbar" class="ui-widget-header ui-corner-all">
    @Html.ActionLink(Resources.Back_To_List, "Index", "GuestGroups", null, new { @class = "backLink" })
    @Html.ActionLink(Resources.ExportToExcel, "ExcelReport", null, new { @class = "excelButtonLink" })
</div>

<div class="ui-widget-content ui-corner-all uiframe">
    <h3 class="ui-widget-header ui-corner-all uiframeh3">
        @Resources.Guests
    </h3>
    <div class="margintop">
        <div id="guestsDiv">
            <div class="loaderAjax"></div>
        </div>
    </div>
</div>

@section Scripts{

    <script type="text/javascript">
        var retr = '@Resources.RetrievingData <img src="/Content/images/AjaxLoader.gif" width="16" height="16" />';
        $(function () {
            $(".createIconLink").button({
                icons: {
                    primary: "ui-icon-plus"

                }//,
                //text: false
            });

            $(".backLink").button({
                icons: {
                    primary: "ui-icon-triangle-1-w"
                }
            });

            $(".guestsIconLink").button({
                icons: {
                    primary: "ui-icon-clipboard"

                }//,
                //text: false
            });

            $(".excelButtonLink").button();

            loadHtmlAjax("#guestsDiv", "@Url.Action("IndexAjax", "Guests")");
        });

        function loadHtmlAjax(div, url) {
            $(div).html('<div class="loaderAjax"></div>');
            $.ajax({
                url: url,
                type: 'GET',
                cache: false,
                success: function (result) {
                    $(div).hide();
                    $(div).html(result).show();
                    $('tr:odd').addClass("oddrow");
                    $(".editIconLink").button({
                        icons: {
                            primary: "ui-icon-pencil"
                        },
                        text: false
                    });
                    $(".deleteIconLink").button({
                        icons: {
                            primary: "ui-icon-trash"
                        },
                        text: false
                    });
                }
            });
        }

    </script>

}






